<?php

use App\Http\Controllers\Api\ContentController;
use App\Http\Controllers\Api\NewsController;
use App\Http\Controllers\Api\SettingController;
use App\Http\Controllers\InvestmentMeetingController;
use App\Http\Controllers\LoginController;
use App\Http\Controllers\MainController;
use App\Http\Controllers\UploadController;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
 */

// Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
//     return $request->user();
// });
Route::get('/test', function () {
});
Route::post('login', [LoginController::class, 'login']);

Route::prefix('web')->group(function () {
    Route::post('newsLists', [MainController::class, 'NewsLists']);
    Route::post('supportLists', [MainController::class, 'SupportLists']);
    Route::post('supportAll', [MainController::class, 'supportAll']);
    Route::post('SupportGood', [MainController::class, 'SupportGood']);
    Route::post('quotationCreate', [MainController::class, 'QuotationCreate']);
    Route::post('quotationMine', [MainController::class, 'QuotationMine']);
    Route::post('file', [UploadController::class, 'file']);
    Route::post('video', [UploadController::class, 'video']);
    Route::post('imageWang', [UploadController::class, 'imageWang']);
    Route::post('sendMsg', [LoginController::class, 'sendMsg']);
    Route::post('mobileLogin', [LoginController::class, 'mobileLogin']);
    Route::post('videoWang', [UploadController::class, 'videoWang']);



});
Route::prefix('upload')->group(function () {
    Route::post('files', [UploadController::class, 'files']);
    Route::post('file', [UploadController::class, 'file']);
    Route::post('filePdf', [UploadController::class, 'filePdf']);

});
Route::middleware(['auth:sanctum', 'api'])->group(function () {

    Route::prefix('user')->group(function () {
        Route::post('info', [LoginController::class, 'userInfo']);
        Route::post('logout', [LoginController::class, 'logout']);
        Route::post('changePwd', [LoginController::class, 'changePwd']);
    });
    Route::prefix('main')->group(function () {
        Route::post('NewsDelete', [MainController::class, 'NewsDelete']);
        Route::post('NewsCreate', [MainController::class, 'NewsCreate']);
        Route::post('SupportCreate', [MainController::class, 'SupportCreate']);
        Route::post('SupportCreateNew', [MainController::class, 'SupportCreateNew']);
        Route::post('SupportDelete', [MainController::class, 'SupportDelete']);
        Route::post('QuotationLists', [MainController::class, 'QuotationLists']);
        Route::post('personList', [MainController::class, 'personList']);
        Route::post('QuotationEditAdmin', [MainController::class, 'QuotationEditAdmin']);
    });
    Route::prefix('news')->group(function () {
        Route::post('categoryList', [NewsController::class, 'categoryList']);
        Route::post('categoryUpdateOrCreate', [NewsController::class, 'categoryUpdateOrCreate']);
        Route::post('categoryDelete', [NewsController::class, 'categoryDelete']);
    });
    Route::prefix('content')->group(function () {
        Route::post('lists', [ContentController::class, 'lists']);
        Route::post('updateOrCreate', [ContentController::class, 'updateOrCreate']);
        Route::post('delete', [ContentController::class, 'delete']);
        Route::post('updateOrCreateItem', [ContentController::class, 'updateOrCreateItem']);
        Route::post('deleteItem', [ContentController::class, 'deleteItem']);
    });
    Route::prefix('setting')->group(function () {
        Route::post('lists', [SettingController::class, 'lists']);
        Route::post('updateOrCreate', [SettingController::class, 'updateOrCreate']);
    });
});
